import React from 'react'
import {NavLink,Navigate ,Routes,Route, useNavigate, useLocation} from 'react-router-dom'

export default function Page6() {
  const navgate=useNavigate()
  console.log(navgate);
  return (
    <div>
       <NavLink to='/Navigateto/12?to=11' state={{asss:1}}>非对象形式</NavLink>
       {/*pathname带问号直接报错  */}
       <NavLink to={{pathname:"/Navigateto/12",search:'?to=11',state:{asss:1},query:{asss:2}}}>对象形式（对象里面的state）</NavLink>
       <NavLink to={{pathname:"/Navigateto/12",search:'?to=11',query:{asss:2}}} state={{asss:1}}>对象形式（和上一条反之）</NavLink>
    </div>
  )
}
